<template>
	<view>
		<view class="search-all-wrap">
			<view class="search-wrap">
				<text class="iconfont icon-faxianchaxun"
					style="color: #fe466b; font-size: 45rpx; margin-right: 20rpx;"></text>
				<input class="uni-input" style="width: 550rpx;" placeholder="请输入你要搜索的内容" :disabled="disabled" confirm-type="search" 
					placeholder-style="color:#C7C7C7; font-size:20rpx;" v-model="searchValue" @blur='loseFoucs'/>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			value: String,
			disabled: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				searchValue:'',
			}
		},
		watch:{
			value(val){
				this.searchValue = val
			}
		},
		methods:{
			loseFoucs(){
				console.log(this.value)
				this.$emit('search', this.searchValue)
			},
		}
	}
</script>

<style>
	.search-all-wrap {
		margin-left: 2%;
		margin-top: 10rpx;
		width: 90%;
		height: 60rpx;
	}

	.search-wrap {
		width: 100%;
		height: 100%;
		line-height: 60rpx;
		border-radius: 30rpx;
		margin-left: 20rpx;
		padding-left: 20rpx;
		background-color: #F5F5F5;
		float: left;
	}

	.uni-input {
		float: left;
		background-color: #F5F5F5;
		height: 100%;
		padding: 0;
	}
</style>
